Repetier-Firmware  1.0.0
Printer.h
Go to the documentation of this file.
1 /*
2  This file is part of Repetier-Firmware.
3 
4  Repetier-Firmware is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  Repetier-Firmware is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with Repetier-Firmware. If not, see <http://www.gnu.org/licenses/>.
16 
17  This firmware is a nearly complete rewrite of the sprinter firmware
18  by kliment (https://github.com/kliment/Sprinter)
19  which based on Tonokip RepRap firmware rewrite based off of Hydra-mmm firmware.
20 */
21 
42 #ifndef PRINTER_H_INCLUDED
43 #define PRINTER_H_INCLUDED
44 
45 union floatLong {
46  float f;
47  uint32_t l;
48 #ifdef SUPPORT_64_BIT_MATH
49  uint64_t L;
50 #endif
51 };
52 
53 union wizardVar {
54  float f;
55  int32_t l;
56  uint32_t ul;
57  int16_t i;
58  uint16_t ui;
59  int8_t c;
60  uint8_t uc;
61 
62  wizardVar(): i(0) {}
63  wizardVar(float _f): f(_f) {}
64  wizardVar(int32_t _f): l(_f) {}
65  wizardVar(uint32_t _f): ul(_f) {}
66  wizardVar(int16_t _f): i(_f) {}
67  wizardVar(uint16_t _f): ui(_f) {}
68  wizardVar(int8_t _f): c(_f) {}
69  wizardVar(uint8_t _f): uc(_f) {}
70 };
71 
72 #define PRINTER_FLAG0_STEPPER_DISABLED 1
73 #define PRINTER_FLAG0_SEPERATE_EXTRUDER_INT 2
74 #define PRINTER_FLAG0_TEMPSENSOR_DEFECT 4
75 #define PRINTER_FLAG0_FORCE_CHECKSUM 8
76 #define PRINTER_FLAG0_MANUAL_MOVE_MODE 16
77 #define PRINTER_FLAG0_AUTOLEVEL_ACTIVE 32
78 #define PRINTER_FLAG0_ZPROBEING 64
79 #define PRINTER_FLAG0_LARGE_MACHINE 128
80 #define PRINTER_FLAG1_HOMED_ALL 1
81 #define PRINTER_FLAG1_AUTOMOUNT 2
82 #define PRINTER_FLAG1_ANIMATION 4
83 #define PRINTER_FLAG1_ALLKILLED 8
84 #define PRINTER_FLAG1_UI_ERROR_MESSAGE 16
85 #define PRINTER_FLAG1_NO_DESTINATION_CHECK 32
86 #define PRINTER_FLAG1_POWER_ON 64
87 #define PRINTER_FLAG1_ALLOW_COLD_EXTRUSION 128
88 #define PRINTER_FLAG2_BLOCK_RECEIVING 1
89 #define PRINTER_FLAG2_AUTORETRACT 2
90 #define PRINTER_FLAG2_RESET_FILAMENT_USAGE 4
91 #define PRINTER_FLAG2_IGNORE_M106_COMMAND 8
92 #define PRINTER_FLAG2_DEBUG_JAM 16
93 #define PRINTER_FLAG2_JAMCONTROL_DISABLED 32
94 #define PRINTER_FLAG2_HOMING 64
95 #define PRINTER_FLAG2_ALL_E_MOTORS 128 // Set all e motors flag
96 #define PRINTER_FLAG3_X_HOMED 1
97 #define PRINTER_FLAG3_Y_HOMED 2
98 #define PRINTER_FLAG3_Z_HOMED 4
99 #define PRINTER_FLAG3_PRINTING 8 // set explicitly with M530
100 #define PRINTER_FLAG3_AUTOREPORT_TEMP 16
101 #define PRINTER_FLAG3_SUPPORTS_STARTSTOP 32
102 #define PRINTER_FLAG3_DOOR_OPEN 64
103 
104 // List of possible interrupt events (1-255 allowed)
105 #define PRINTER_INTERRUPT_EVENT_JAM_DETECTED 1
106 #define PRINTER_INTERRUPT_EVENT_JAM_SIGNAL0 2
107 #define PRINTER_INTERRUPT_EVENT_JAM_SIGNAL1 3
108 #define PRINTER_INTERRUPT_EVENT_JAM_SIGNAL2 4
109 #define PRINTER_INTERRUPT_EVENT_JAM_SIGNAL3 5
110 #define PRINTER_INTERRUPT_EVENT_JAM_SIGNAL4 6
111 #define PRINTER_INTERRUPT_EVENT_JAM_SIGNAL5 7
112 // define an integer number of steps more than large enough to get to end stop from anywhere
113 #define HOME_DISTANCE_STEPS (Printer::zMaxSteps-Printer::zMinSteps+1000)
114 #define HOME_DISTANCE_MM (HOME_DISTANCE_STEPS * invAxisStepsPerMM[Z_AXIS])
115 // Some defines to make clearer reading, as we overload these Cartesian memory locations for delta
116 #define towerAMaxSteps Printer::xMaxSteps
117 #define towerBMaxSteps Printer::yMaxSteps
118 #define towerCMaxSteps Printer::zMaxSteps
119 #define towerAMinSteps Printer::xMinSteps
120 #define towerBMinSteps Printer::yMinSteps
121 #define towerCMinSteps Printer::zMinSteps
122 
123 class Plane {
124 public:
125  // f(x, y) = ax + by + c
126  float a, b, c;
127  float z(float x, float y) {
128  return a * x + y * b + c;
129  }
130 };
131 
132 #include "Distortion.h"
133 
134 #include "Endstops.h"
135 
136 #ifndef DEFAULT_PRINTER_MODE
137 #if NUM_EXTRUDER > 0
138 #define DEFAULT_PRINTER_MODE PRINTER_MODE_FFF
139 #elif defined(SUPPORT_LASER) && SUPPORT_LASER
140 #define DEFAULT_PRINTER_MODE PRINTER_MODE_LASER
141 #elif defined(SUPPORT_CNC) && SUPPORT_CNC
142 #define DEFAULT_PRINTER_MODE PRINTER_MODE_CNC
143 #else
144 #error No supported printer mode compiled
145 #endif
146 #endif
147 
148 extern bool runBedLeveling(int save); // save = S parameter in gcode
149 
234 class Printer {
235  static uint8_t debugLevel;
236 public:
237 #if USE_ADVANCE || defined(DOXYGEN)
238  static volatile int extruderStepsNeeded;
240  //static uint8_t extruderAccelerateDelay; ///< delay between 2 speec increases
241  static int advanceStepsSet;
242 #if ENABLE_QUADRATIC_ADVANCE || defined(DOXYGEN)
243  static long advanceExecuted;
244 #endif
245 #endif
246  static uint16_t menuMode;
247 #if DUAL_X_RESOLUTION || defined(DOXYGEN)
248  static float axisX1StepsPerMM;
249  static float axisX2StepsPerMM;
250 #endif
251  static float axisStepsPerMM[];
252  static float invAxisStepsPerMM[];
253  static float maxFeedrate[];
254  static float homingFeedrate[]; // Feedrate in mm/s for homing.
255  static uint32_t maxInterval; // slowest allowed interval
256  static float maxAccelerationMMPerSquareSecond[];
257  static float maxTravelAccelerationMMPerSquareSecond[];
258  static unsigned long maxPrintAccelerationStepsPerSquareSecond[];
259  static unsigned long maxTravelAccelerationStepsPerSquareSecond[];
260  static uint8_t relativeCoordinateMode;
262 
263  static uint8_t unitIsInches;
264  static uint8_t mode;
265  static uint8_t fanSpeed; // Last fan speed set with M106/M107
267  static float zBedOffset;
268  static uint8_t flag0, flag1; // 1 = stepper disabled, 2 = use external extruder interrupt, 4 = temp Sensor defect, 8 = homed
269  static uint8_t flag2, flag3;
270  static uint32_t interval;
271  static uint32_t timer;
272  static uint32_t stepNumber;
273  static float coordinateOffset[Z_AXIS_ARRAY];
274  static int32_t currentPositionSteps[E_AXIS_ARRAY];
275  static float currentPosition[Z_AXIS_ARRAY];
276  static float lastCmdPos[Z_AXIS_ARRAY];
277  static int32_t destinationSteps[E_AXIS_ARRAY];
279  static float extrudeMultiplyError;
280  static float extrusionFactor;
281 #if NONLINEAR_SYSTEM || defined(DOXYGEN)
282  static int32_t maxDeltaPositionSteps;
283  static int32_t currentNonlinearPositionSteps[E_TOWER_ARRAY];
287  static float deltaMaxRadiusSquared;
289  static int32_t deltaAPosXSteps;
290  static int32_t deltaAPosYSteps;
291  static int32_t deltaBPosXSteps;
292  static int32_t deltaBPosYSteps;
293  static int32_t deltaCPosXSteps;
294  static int32_t deltaCPosYSteps;
295  static int32_t realDeltaPositionSteps[TOWER_ARRAY];
296  static int16_t travelMovesPerSecond;
297  static int16_t printMovesPerSecond;
298  static float radius0;
299 #endif
300 #if !NONLINEAR_SYSTEM || defined(FAST_COREXYZ) || defined(DOXYGEN)
301  static int32_t xMinStepsAdj, yMinStepsAdj, zMinStepsAdj; // adjusted to cover extruder/probe offsets
302  static int32_t xMaxStepsAdj, yMaxStepsAdj, zMaxStepsAdj;
303 #endif
304 #if DRIVE_SYSTEM != DELTA || defined(DOXYGEN)
305  static int32_t zCorrectionStepsIncluded;
306 #endif
307 #if FEATURE_Z_PROBE || MAX_HARDWARE_ENDSTOP_Z || NONLINEAR_SYSTEM || defined(DOXYGEN)
308  static int32_t stepsRemainingAtZHit;
309 #endif
310 #if DRIVE_SYSTEM == DELTA || defined(DOXYGEN)
311  static int32_t stepsRemainingAtXHit;
312  static int32_t stepsRemainingAtYHit;
313 #endif
314 #if SOFTWARE_LEVELING || defined(DOXYGEN)
315  static int32_t levelingP1[3];
316  static int32_t levelingP2[3];
317  static int32_t levelingP3[3];
318 #endif
319 #if FEATURE_AUTOLEVEL || defined(DOXYGEN)
320  static float autolevelTransformation[9];
321 #endif
322 #if FAN_THERMO_PIN > -1 || defined(DOXYGEN)
323  static float thermoMinTemp;
324  static float thermoMaxTemp;
325 #endif
326 #if LAZY_DUAL_X_AXIS || defined(DOXYGEN)
327  static bool sledParked;
328 #endif
329 #if FEATURE_BABYSTEPPING || defined(DOXYGEN)
330  static int16_t zBabystepsMissing;
331  static int16_t zBabysteps;
332 #endif
333  //static float minimumSpeed; ///< lowest allowed speed to keep integration error small
334  //static float minimumZSpeed; ///< lowest allowed speed to keep integration error small
335  static int32_t xMaxSteps;
336  static int32_t yMaxSteps;
337  static int32_t zMaxSteps;
338  static int32_t xMinSteps;
339  static int32_t yMinSteps;
340  static int32_t zMinSteps;
341  static float xLength;
342  static float xMin;
343  static float yLength;
344  static float yMin;
345  static float zLength;
346  static float zMin;
347  static float feedrate;
348  static int feedrateMultiply;
349  static unsigned int extrudeMultiply;
350  static float maxJerk;
351  static uint8_t interruptEvent;
352 #if DRIVE_SYSTEM!=DELTA || defined(DOXYGEN)
353  static float maxZJerk;
354 #endif
355  static float offsetX;
356  static float offsetY;
357  static float offsetZ;
358  static float offsetZ2;
360  static uint32_t msecondsPrinting;
361  static float filamentPrinted;
362 #if ENABLE_BACKLASH_COMPENSATION || defined(DOXYGEN)
363  static float backlashX;
364  static float backlashY;
365  static float backlashZ;
366  static uint8_t backlashDir;
367 #endif
368 #if MULTI_ZENDSTOP_HOMING || defined(DOXYGEN)
369  static fast8_t multiZHomeFlags; // 1 = move Z0, 2 = move Z1
370 #endif
371  static float memoryX;
372  static float memoryY;
373  static float memoryZ;
374  static float memoryE;
375  static float memoryF;
376 #if (GANTRY && !defined(FAST_COREXYZ)) || defined(DOXYGEN)
377  static int8_t motorX;
378  static int8_t motorYorZ;
379 #endif
380 #ifdef DEBUG_SEGMENT_LENGTH
381  static float maxRealSegmentLength;
382 #endif
383 #ifdef DEBUG_REAL_JERK
384  static float maxRealJerk;
385 #endif
386  // Print status related
387  static int currentLayer;
388  static int maxLayer; // -1 = unknown
389  static char printName[21]; // max. 20 chars + 0
390  static float progress;
392  static wizardVar wizardStack[WIZARD_STACK_SIZE];
393 
394  static void handleInterruptEvent();
395 
396  static INLINE void setInterruptEvent(uint8_t evt, bool highPriority) {
397  if(highPriority || interruptEvent == 0)
398  interruptEvent = evt;
399  }
400  static void reportPrinterMode();
401  static INLINE void setMenuMode(uint16_t mode, bool on) {
402  if(on)
403  menuMode |= mode;
404  else
405  menuMode &= ~mode;
406  }
407 
408  static INLINE bool isMenuMode(uint8_t mode) {
409  return (menuMode & mode) == mode;
410  }
411  static void setDebugLevel(uint8_t newLevel);
412  static void toggleEcho();
413  static void toggleInfo();
414  static void toggleErrors();
415  static void toggleDryRun();
416  static void toggleCommunication();
417  static void toggleNoMoves();
418  static void toggleEndStop();
419  static INLINE uint8_t getDebugLevel() {
420  return debugLevel;
421  }
422  static INLINE bool debugEcho() {
423  return ((debugLevel & 1) != 0);
424  }
425 
426  static INLINE bool debugInfo() {
427  return ((debugLevel & 2) != 0);
428  }
429 
430  static INLINE bool debugErrors() {
431  return ((debugLevel & 4) != 0);
432  }
433 
434  static INLINE bool debugDryrun() {
435  return ((debugLevel & 8) != 0);
436  }
437 
438  static INLINE bool debugCommunication() {
439  return ((debugLevel & 16) != 0);
440  }
441 
442  static INLINE bool debugNoMoves() {
443  return ((debugLevel & 32) != 0);
444  }
445 
446  static INLINE bool debugEndStop() {
447  return ((debugLevel & 64) != 0);
448  }
449 
450  static INLINE bool debugFlag(uint8_t flags) {
451  return (debugLevel & flags);
452  }
453 
454  static INLINE void debugSet(uint8_t flags) {
455  setDebugLevel(debugLevel | flags);
456  }
457 
458  static INLINE void debugReset(uint8_t flags) {
459  setDebugLevel(debugLevel & ~flags);
460  }
462  static void setFanSpeedDirectly(uint8_t speed);
464  static void setFan2SpeedDirectly(uint8_t speed);
466  static INLINE void disableXStepper() {
467 #if (X_ENABLE_PIN > -1)
469 #endif
470 #if (FEATURE_TWO_XSTEPPER || DUAL_X_AXIS) && (X2_ENABLE_PIN > -1)
472 #endif
473  }
474 
476  static INLINE void disableYStepper() {
477 #if (Y_ENABLE_PIN > -1)
479 #endif
480 #if FEATURE_TWO_YSTEPPER && (Y2_ENABLE_PIN > -1)
482 #endif
483  }
485  static INLINE void disableZStepper() {
486 #if (Z_ENABLE_PIN > -1)
488 #endif
489 #if FEATURE_TWO_ZSTEPPER && (Z2_ENABLE_PIN > -1)
491 #endif
492 #if FEATURE_THREE_ZSTEPPER && (Z3_ENABLE_PIN > -1)
494 #endif
495 #if FEATURE_FOUR_ZSTEPPER && (Z4_ENABLE_PIN > -1)
497 #endif
498  }
499 
501  static INLINE void enableXStepper() {
502 #if (X_ENABLE_PIN > -1)
504 #endif
505 #if (FEATURE_TWO_XSTEPPER || DUAL_X_AXIS) && (X2_ENABLE_PIN > -1)
507 #endif
508  }
509 
511  static INLINE void enableYStepper() {
512 #if (Y_ENABLE_PIN > -1)
514 #endif
515 #if FEATURE_TWO_YSTEPPER && (Y2_ENABLE_PIN > -1)
517 #endif
518  }
520  static INLINE void enableZStepper() {
521 #if (Z_ENABLE_PIN > -1)
523 #endif
524 #if FEATURE_TWO_ZSTEPPER && (Z2_ENABLE_PIN > -1)
526 #endif
527 #if FEATURE_THREE_ZSTEPPER && (Z3_ENABLE_PIN > -1)
529 #endif
530 #if FEATURE_FOUR_ZSTEPPER && (Z4_ENABLE_PIN > -1)
532 #endif
533  }
534 
535  static INLINE void setXDirection(bool positive) {
536  if(positive) {
538 #if FEATURE_TWO_XSTEPPER || DUAL_X_AXIS
540 #endif
541  } else {
543 #if FEATURE_TWO_XSTEPPER || DUAL_X_AXIS
545 #endif
546  }
547  }
548 
549  static INLINE void setYDirection(bool positive) {
550  if(positive) {
552 #if FEATURE_TWO_YSTEPPER
554 #endif
555  } else {
557 #if FEATURE_TWO_YSTEPPER
559 #endif
560  }
561  }
562  static INLINE void setZDirection(bool positive) {
563  if(positive) {
565 #if FEATURE_TWO_ZSTEPPER
567 #endif
568 #if FEATURE_THREE_ZSTEPPER
570 #endif
571 #if FEATURE_FOUR_ZSTEPPER
573 #endif
574  } else {
576 #if FEATURE_TWO_ZSTEPPER
578 #endif
579 #if FEATURE_THREE_ZSTEPPER
581 #endif
582 #if FEATURE_FOUR_ZSTEPPER
584 #endif
585  }
586  }
587 
588  static INLINE bool getZDirection() {
589  return ((READ(Z_DIR_PIN) != 0) ^ INVERT_Z_DIR);
590  }
591 
592  static INLINE bool getYDirection() {
593  return((READ(Y_DIR_PIN) != 0) ^ INVERT_Y_DIR);
594  }
595 
596  static INLINE bool getXDirection() {
597  return((READ(X_DIR_PIN) != 0) ^ INVERT_X_DIR);
598  }
599 
601  static INLINE uint8_t isLargeMachine() {
602  return flag0 & PRINTER_FLAG0_LARGE_MACHINE;
603  }
604 
605  static INLINE void setLargeMachine(uint8_t b) {
606  flag0 = (b ? flag0 | PRINTER_FLAG0_LARGE_MACHINE : flag0 & ~PRINTER_FLAG0_LARGE_MACHINE);
607  }
608 
609  static INLINE uint8_t isAdvanceActivated() {
611  }
612 
613  static INLINE void setAdvanceActivated(uint8_t b) {
615  }
616 
617  static INLINE uint8_t isHomedAll() {
618  return flag1 & PRINTER_FLAG1_HOMED_ALL;
619  }
620 
621  static INLINE void unsetHomedAll() {
622  flag1 &= ~PRINTER_FLAG1_HOMED_ALL;
624  }
625 
626  static INLINE void updateHomedAll() {
627  bool b = isXHomed() && isYHomed() && isZHomed();
628  flag1 = (b ? flag1 | PRINTER_FLAG1_HOMED_ALL : flag1 & ~PRINTER_FLAG1_HOMED_ALL);
629  }
630 
631  static INLINE uint8_t isXHomed() {
632  return flag3 & PRINTER_FLAG3_X_HOMED;
633  }
634 
635  static INLINE void setXHomed(uint8_t b) {
636  flag3 = (b ? flag3 | PRINTER_FLAG3_X_HOMED : flag3 & ~PRINTER_FLAG3_X_HOMED);
637  updateHomedAll();
638  }
639 
640  static INLINE uint8_t isYHomed() {
641  return flag3 & PRINTER_FLAG3_Y_HOMED;
642  }
643 
644  static INLINE void setYHomed(uint8_t b) {
645  flag3 = (b ? flag3 | PRINTER_FLAG3_Y_HOMED : flag3 & ~PRINTER_FLAG3_Y_HOMED);
646  updateHomedAll();
647  }
648 
649  static INLINE uint8_t isZHomed() {
650  return flag3 & PRINTER_FLAG3_Z_HOMED;
651  }
652 
653  static INLINE void setZHomed(uint8_t b) {
654  flag3 = (b ? flag3 | PRINTER_FLAG3_Z_HOMED : flag3 & ~PRINTER_FLAG3_Z_HOMED);
655  updateHomedAll();
656  }
657  static INLINE uint8_t isAutoreportTemp() {
658  return flag3 & PRINTER_FLAG3_AUTOREPORT_TEMP;
659  }
660 
661  static INLINE void setAutoreportTemp(uint8_t b) {
662  flag3 = (b ? flag3 | PRINTER_FLAG3_AUTOREPORT_TEMP : flag3 & ~PRINTER_FLAG3_AUTOREPORT_TEMP);
663  }
664 
665  static INLINE uint8_t isAllKilled() {
666  return flag1 & PRINTER_FLAG1_ALLKILLED;
667  }
668 
669  static INLINE void setAllKilled(uint8_t b) {
670  flag1 = (b ? flag1 | PRINTER_FLAG1_ALLKILLED : flag1 & ~PRINTER_FLAG1_ALLKILLED);
671  }
672 
673  static INLINE uint8_t isAutomount() {
674  return flag1 & PRINTER_FLAG1_AUTOMOUNT;
675  }
676 
677  static INLINE void setAutomount(uint8_t b) {
678  flag1 = (b ? flag1 | PRINTER_FLAG1_AUTOMOUNT : flag1 & ~PRINTER_FLAG1_AUTOMOUNT);
679  }
680 
681  static INLINE uint8_t isAnimation() {
682  return flag1 & PRINTER_FLAG1_ANIMATION;
683  }
684 
685  static INLINE void setAnimation(uint8_t b) {
686  flag1 = (b ? flag1 | PRINTER_FLAG1_ANIMATION : flag1 & ~PRINTER_FLAG1_ANIMATION);
687  }
688 
689  static INLINE uint8_t isUIErrorMessage() {
690  return flag1 & PRINTER_FLAG1_UI_ERROR_MESSAGE;
691  }
692 
693  static INLINE void setUIErrorMessage(uint8_t b) {
694  flag1 = (b ? flag1 | PRINTER_FLAG1_UI_ERROR_MESSAGE : flag1 & ~PRINTER_FLAG1_UI_ERROR_MESSAGE);
695  }
696 
697  static INLINE uint8_t isNoDestinationCheck() {
698  return flag1 & PRINTER_FLAG1_NO_DESTINATION_CHECK;
699  }
700 
701  static INLINE void setNoDestinationCheck(uint8_t b) {
703  }
704 
705  static INLINE uint8_t isPowerOn() {
706  return flag1 & PRINTER_FLAG1_POWER_ON;
707  }
708 
709  static INLINE void setPowerOn(uint8_t b) {
710  flag1 = (b ? flag1 | PRINTER_FLAG1_POWER_ON : flag1 & ~PRINTER_FLAG1_POWER_ON);
711  }
712 
713  static INLINE uint8_t isColdExtrusionAllowed() {
714  return flag1 & PRINTER_FLAG1_ALLOW_COLD_EXTRUSION;
715  }
716 
717  static INLINE void setColdExtrusionAllowed(uint8_t b) {
719  if(b)
720  Com::printFLN(PSTR("Cold extrusion allowed"));
721  else
722  Com::printFLN(PSTR("Cold extrusion disallowed"));
723  }
724 
725  static INLINE uint8_t isBlockingReceive() {
726  return flag2 & PRINTER_FLAG2_BLOCK_RECEIVING;
727  }
728 
729  static INLINE void setBlockingReceive(uint8_t b) {
730  flag2 = (b ? flag2 | PRINTER_FLAG2_BLOCK_RECEIVING : flag2 & ~PRINTER_FLAG2_BLOCK_RECEIVING);
731  Com::printFLN(b ? Com::tPauseCommunication : Com::tContinueCommunication);
732  }
733 
734  static INLINE uint8_t isAutoretract() {
735  return flag2 & PRINTER_FLAG2_AUTORETRACT;
736  }
737 
738  static INLINE void setAutoretract(uint8_t b) {
739  flag2 = (b ? flag2 | PRINTER_FLAG2_AUTORETRACT : flag2 & ~PRINTER_FLAG2_AUTORETRACT);
740  Com::printFLN(PSTR("Autoretract:"), b);
741  }
742 
743  static INLINE uint8_t isPrinting() {
744  return flag3 & PRINTER_FLAG3_PRINTING;
745  }
746 
747  static INLINE void setPrinting(uint8_t b) {
748  flag3 = (b ? flag3 | PRINTER_FLAG3_PRINTING : flag3 & ~PRINTER_FLAG3_PRINTING);
750  }
751 
752  static INLINE uint8_t isStartStopSupported() {
753  return flag3 & PRINTER_FLAG3_SUPPORTS_STARTSTOP;
754  }
755 
756  static INLINE void setSupportStartStop(uint8_t b) {
758  }
759 
760  static INLINE uint8_t isDoorOpen() {
761  return (flag3 & PRINTER_FLAG3_DOOR_OPEN) != 0;
762  }
763 
764  static bool updateDoorOpen();
765 
766  static INLINE uint8_t isHoming() {
767  return flag2 & PRINTER_FLAG2_HOMING;
768  }
769 
770  static INLINE void setHoming(uint8_t b) {
771  flag2 = (b ? flag2 | PRINTER_FLAG2_HOMING : flag2 & ~PRINTER_FLAG2_HOMING);
772  }
773  static INLINE uint8_t isAllEMotors() {
774  return flag2 & PRINTER_FLAG2_ALL_E_MOTORS;
775  }
776 
777  static INLINE void setAllEMotors(uint8_t b) {
778  flag2 = (b ? flag2 | PRINTER_FLAG2_ALL_E_MOTORS : flag2 & ~PRINTER_FLAG2_ALL_E_MOTORS);
779  }
780 
781  static INLINE uint8_t isDebugJam() {
782  return (flag2 & PRINTER_FLAG2_DEBUG_JAM) != 0;
783  }
784 
785  static INLINE uint8_t isDebugJamOrDisabled() {
787  }
788 
789  static INLINE void setDebugJam(uint8_t b) {
790  flag2 = (b ? flag2 | PRINTER_FLAG2_DEBUG_JAM : flag2 & ~PRINTER_FLAG2_DEBUG_JAM);
791  Com::printFLN(PSTR("Jam debugging:"), b);
792  }
793 
794  static INLINE uint8_t isJamcontrolDisabled() {
795  return (flag2 & PRINTER_FLAG2_JAMCONTROL_DISABLED) != 0;
796  }
797 
798  static INLINE void setJamcontrolDisabled(uint8_t b) {
799 #if EXTRUDER_JAM_CONTROL
800  if(b)
801  Extruder::markAllUnjammed();
802 #endif
804  Com::printFLN(PSTR("Jam control disabled:"), b);
805  }
806 
807  static INLINE void toggleAnimation() {
808  setAnimation(!isAnimation());
809  }
810  static INLINE float convertToMM(float x) {
811  return (unitIsInches ? x * 25.4 : x);
812  }
814  return flag0 & PRINTER_FLAG0_STEPPER_DISABLED;
815  }
818  }
821 #if FAN_BOARD_PIN > -1
823 #endif // FAN_BOARD_PIN
824  }
826  return (flag0 & PRINTER_FLAG0_TEMPSENSOR_DEFECT);
827  }
830  debugSet(8);
831  }
834  }
835  static INLINE bool isManualMoveMode() {
836  return (flag0 & PRINTER_FLAG0_MANUAL_MOVE_MODE);
837  }
838  static INLINE void setManualMoveMode(bool on) {
839  flag0 = (on ? flag0 | PRINTER_FLAG0_MANUAL_MOVE_MODE : flag0 & ~PRINTER_FLAG0_MANUAL_MOVE_MODE);
840  }
841  static INLINE bool isAutolevelActive() {
842  return (flag0 & PRINTER_FLAG0_AUTOLEVEL_ACTIVE) != 0;
843  }
844  static void setAutolevelActive(bool on);
845  static INLINE void setZProbingActive(bool on) {
846  flag0 = (on ? flag0 | PRINTER_FLAG0_ZPROBEING : flag0 & ~PRINTER_FLAG0_ZPROBEING);
847  }
848  static INLINE bool isZProbingActive() {
849  return (flag0 & PRINTER_FLAG0_ZPROBEING);
850  }
851  static INLINE void executeXYGantrySteps() {
852 #if (GANTRY) && !defined(FAST_COREXYZ)
853  if(motorX <= -2) {
855 #if FEATURE_TWO_XSTEPPER
857 #endif
858  motorX += 2;
859  } else if(motorX >= 2) {
861 #if FEATURE_TWO_XSTEPPER
863 #endif
864  motorX -= 2;
865  }
866  if(motorYorZ <= -2) {
868 #if FEATURE_TWO_YSTEPPER
870 #endif
871  motorYorZ += 2;
872  } else if(motorYorZ >= 2) {
874 #if FEATURE_TWO_YSTEPPER
876 #endif
877  motorYorZ -= 2;
878  }
879 #endif
880  }
881  static INLINE void executeXZGantrySteps() {
882 #if (GANTRY) && !defined(FAST_COREXYZ)
883  if(motorX <= -2) {
885 #if FEATURE_TWO_XSTEPPER
887 #endif
888  motorX += 2;
889  } else if(motorX >= 2) {
891 #if FEATURE_TWO_XSTEPPER
893 #endif
894  motorX -= 2;
895  }
896  if(motorYorZ <= -2) {
898 #if FEATURE_TWO_ZSTEPPER
900 #endif
901 #if FEATURE_THREE_ZSTEPPER
903 #endif
904 #if FEATURE_FOUR_ZSTEPPER
906 #endif
907  motorYorZ += 2;
908  } else if(motorYorZ >= 2) {
910 #if FEATURE_TWO_ZSTEPPER
912 #endif
913 #if FEATURE_THREE_ZSTEPPER
915 #endif
916 #if FEATURE_FOUR_ZSTEPPER
918 #endif
919  motorYorZ -= 2;
920  }
921 #endif
922  }
923  static INLINE void startXStep() {
924 #if DUAL_X_AXIS
925 #if FEATURE_DITTO_PRINTING
926  if(Extruder::dittoMode) {
929  return;
930  }
931 #endif
932  if(Extruder::current->id) {
934  } else {
936  }
937 #else
939 #if FEATURE_TWO_XSTEPPER
941 #endif
942 #endif
943  }
944  static INLINE void startYStep() {
946 #if FEATURE_TWO_YSTEPPER
948 #endif
949  }
950  static INLINE void startZStep() {
951 #if MULTI_ZENDSTOP_HOMING
952  if(Printer::multiZHomeFlags & 1) {
954  }
955 #if FEATURE_TWO_ZSTEPPER
956  if(Printer::multiZHomeFlags & 2) {
958  }
959 #endif
960 #if FEATURE_THREE_ZSTEPPER
961  if(Printer::multiZHomeFlags & 4) {
963  }
964 #endif
965 #if FEATURE_FOUR_ZSTEPPER
966  if(Printer::multiZHomeFlags & 8) {
968  }
969 #endif
970 #else
972 #if FEATURE_TWO_ZSTEPPER
974 #endif
975 #if FEATURE_THREE_ZSTEPPER
977 #endif
978 #if FEATURE_FOUR_ZSTEPPER
980 #endif
981 #endif
982  }
983  static INLINE void endXYZSteps() {
985 #if FEATURE_TWO_XSTEPPER || DUAL_X_AXIS
987 #endif
989 #if FEATURE_TWO_YSTEPPER
991 #endif
993 #if FEATURE_TWO_ZSTEPPER
995 #endif
996 #if FEATURE_THREE_ZSTEPPER
998 #endif
999 #if FEATURE_FOUR_ZSTEPPER
1001 #endif
1002  }
1004  if(vbase > STEP_DOUBLER_FREQUENCY) {
1005 #if ALLOW_QUADSTEPPING
1006  if(vbase > STEP_DOUBLER_FREQUENCY * 2) {
1008  return vbase >> 2;
1009  } else {
1011  return vbase >> 1;
1012  }
1013 #else
1015  return vbase >> 1;
1016 #endif
1017  } else {
1019  }
1020  return vbase;
1021  }
1023 #if DRIVE_SYSTEM == XZ_GANTRY || DRIVE_SYSTEM == ZX_GANTRY
1024  if(DISABLE_X && DISABLE_Z) {
1025  disableXStepper();
1026  disableZStepper();
1027  }
1028  if(DISABLE_Y) disableYStepper();
1029 #else
1030 #if GANTRY
1031  if(DISABLE_X && DISABLE_Y) {
1032  disableXStepper();
1033  disableYStepper();
1034  }
1035 #else
1036  if(DISABLE_X) disableXStepper();
1037  if(DISABLE_Y) disableYStepper();
1038 #endif
1039  if(DISABLE_Z) disableZStepper();
1040 #endif
1041  }
1042  static INLINE float realXPosition() {
1043  return currentPosition[X_AXIS];
1044  }
1045 
1046  static INLINE float realYPosition() {
1047  return currentPosition[Y_AXIS];
1048  }
1049 
1050  static INLINE float realZPosition() {
1051  return currentPosition[Z_AXIS];
1052  }
1054  static INLINE void realPosition(float &xp, float &yp, float &zp) {
1055  xp = currentPosition[X_AXIS];
1056  yp = currentPosition[Y_AXIS];
1057  zp = currentPosition[Z_AXIS];
1058  }
1060 #if STEPPER_HIGH_DELAY>0
1062 #endif
1063  }
1064  static void updateDerivedParameter();
1067  static void constrainDestinationCoords();
1070  static void updateCurrentPosition(bool copyLastCmd = false);
1071  static void updateCurrentPositionSteps();
1079  static uint8_t setDestinationStepsFromGCode(GCode *com);
1092  static uint8_t moveTo(float x, float y, float z, float e, float f);
1106  static uint8_t moveToReal(float x, float y, float z, float e, float f, bool pathOptimize = true);
1107  static void kill(uint8_t only_steppers);
1108  static void updateAdvanceFlags();
1109  static void setup();
1110  static void defaultLoopActions();
1111  static void homeAxis(bool xaxis, bool yaxis, bool zaxis);
1112  static void setOrigin(float xOff, float yOff, float zOff);
1123  static bool isPositionAllowed(float x, float y, float z);
1124  static INLINE int getFanSpeed() {
1125  return (int)pwm_pos[PWM_FAN1];
1126  }
1127  static INLINE int getFan2Speed() {
1128  return (int)pwm_pos[PWM_FAN2];
1129  }
1130 #if NONLINEAR_SYSTEM || defined(DOXYGEN)
1131  static INLINE void setDeltaPositions(long xaxis, long yaxis, long zaxis) {
1132  currentNonlinearPositionSteps[A_TOWER] = xaxis;
1133  currentNonlinearPositionSteps[B_TOWER] = yaxis;
1134  currentNonlinearPositionSteps[C_TOWER] = zaxis;
1135  }
1136  static void deltaMoveToTopEndstops(float feedrate);
1137 #endif
1138 #if MAX_HARDWARE_ENDSTOP_Z || defined(DOXYGEN)
1139  static float runZMaxProbe();
1140 #endif
1141 #if FEATURE_Z_PROBE || defined(DOXYGEN)
1142  static bool startProbing(bool runScript, bool enforceStartHeight = true);
1143  static void finishProbing();
1144  static float runZProbe(bool first, bool last, uint8_t repeat = Z_PROBE_REPETITIONS, bool runStartScript = true, bool enforceStartHeight = true);
1145  static void measureZProbeHeight(float curHeight);
1146  static void waitForZProbeStart();
1147  static float bendingCorrectionAt(float x, float y);
1148 #endif
1149  // Moved outside FEATURE_Z_PROBE to allow auto-level functional test on
1150  // system without Z-probe
1151  static void transformToPrinter(float x, float y, float z, float &transX, float &transY, float &transZ);
1152  static void transformFromPrinter(float x, float y, float z, float &transX, float &transY, float &transZ);
1153 #if FEATURE_AUTOLEVEL || defined(DOXYGEN)
1154  static void resetTransformationMatrix(bool silent);
1155  //static void buildTransformationMatrix(float h1,float h2,float h3);
1156  static void buildTransformationMatrix(Plane &plane);
1157 #endif
1158 #if DISTORTION_CORRECTION || defined(DOXYGEN)
1159  static void measureDistortion(void);
1161 #endif
1162  static void MemoryPosition();
1163  static void GoToMemoryPosition(bool x, bool y, bool z, bool e, float feed);
1164  static void zBabystep();
1165 
1166  static INLINE void resetWizardStack() {
1167  wizardStackPos = 0;
1168  }
1169  static INLINE void pushWizardVar(wizardVar v) {
1170  wizardStack[wizardStackPos++] = v;
1171  }
1173  return wizardStack[--wizardStackPos];
1174  }
1175  static void showConfiguration();
1176  static void setCaseLight(bool on);
1177  static void reportCaseLightStatus();
1178 #if JSON_OUTPUT || defined(DOXYGEN)
1179  static void showJSONStatus(int type);
1180 #endif
1181  static void homeXAxis();
1182  static void homeYAxis();
1183  static void homeZAxis();
1184  static void pausePrint();
1185  static void continuePrint();
1186  static void stopPrint();
1187 #if FEATURE_Z_PROBE || defined(DOXYGEN)
1188 
1196  static void prepareForProbing();
1197 #endif
1198 };
1199 
1200 #endif // PRINTER_H_INCLUDED
static float radius0
Definition: Printer.h:298
#define PWM_FAN1
Definition: Repetier.h:889
static float memoryZ
Definition: Printer.h:373
#define Y_ENABLE_PIN
Definition: pins.h:3060
static INLINE uint8_t isLargeMachine()
Definition: Printer.h:601
static int feedrateMultiply
Multiplier for feedrate in percent (factor 1 = 100)
Definition: Printer.h:348
static INLINE void setAnimation(uint8_t b)
Definition: Printer.h:685
static INLINE void setAllSteppersDiabled()
Definition: Printer.h:816
static uint8_t flag3
Definition: Printer.h:269
wizardVar(uint32_t _f)
Definition: Printer.h:65
static INLINE speed_t updateStepsPerTimerCall(speed_t vbase)
Definition: Printer.h:1003
static float thermoMaxTemp
Definition: Printer.h:324
static INLINE void setHoming(uint8_t b)
Definition: Printer.h:770
static INLINE bool debugNoMoves()
Definition: Printer.h:442
#define PRINTER_FLAG0_ZPROBEING
Definition: Printer.h:78
#define PRINTER_FLAG3_PRINTING
Definition: Printer.h:99
int8_t c
Definition: Printer.h:59
static INLINE void enableYStepper()
Enable stepper motor for y direction.
Definition: Printer.h:511
static INLINE void disableAllowedStepper()
Definition: Printer.h:1022
#define X_DIR_PIN
Definition: pins.h:3053
static int maxLayer
Definition: Printer.h:388
#define PRINTER_FLAG1_POWER_ON
Definition: Printer.h:86
#define Z_ENABLE_PIN
Definition: pins.h:3066
static INLINE uint8_t isHomedAll()
Definition: Printer.h:617
#define Z3_DIR_PIN
Definition: Configuration.h:1393
static INLINE uint8_t isPrinting()
Definition: Printer.h:743
static INLINE void resetWizardStack()
Definition: Printer.h:1166
static INLINE void startYStep()
Definition: Printer.h:944
#define PRINTER_FLAG3_Z_HOMED
Definition: Printer.h:98
static INLINE void setManualMoveMode(bool on)
Definition: Printer.h:838
static INLINE void unsetHomedAll()
Definition: Printer.h:621
static floatLong deltaDiagonalStepsSquaredC
Definition: Printer.h:286
#define PRINTER_FLAG2_AUTORETRACT
Definition: Printer.h:89
Definition: gcode.h:91
static float offsetZ2
Z-offset without rotation correction. Required for z probe corrections.
Definition: Printer.h:358
static void printFLN(FSTRINGPARAM(text))
Definition: Communication.cpp:526
static INLINE void setUIErrorMessage(uint8_t b)
Definition: Printer.h:693
static uint32_t msecondsPrinting
Milliseconds of printing time (means time with heated extruder)
Definition: Printer.h:360
static INLINE void debugSet(uint8_t flags)
Definition: Printer.h:454
static INLINE void setJamcontrolDisabled(uint8_t b)
Definition: Printer.h:798
static INLINE void setLargeMachine(uint8_t b)
Definition: Printer.h:605
static bool sledParked
Definition: Printer.h:327
Definition: Printer.h:45
#define Y_DIR_PIN
Definition: pins.h:3059
static uint8_t backlashDir
Definition: Printer.h:366
static INLINE void setBlockingReceive(uint8_t b)
Definition: Printer.h:729
wizardVar(uint8_t _f)
Definition: Printer.h:69
#define DISABLE_X
Definition: Configuration.h:884
static INLINE uint8_t isXHomed()
Definition: Printer.h:631
static volatile int extruderStepsNeeded
This many extruder steps are still needed, <0 = reverse steps needed.
Definition: Printer.h:238
wizardVar(int8_t _f)
Definition: Printer.h:68
#define READ(IO)
Read a pin wrapper.
Definition: fastio.h:46
static float progress
Definition: Printer.h:390
static INLINE void setAutoretract(uint8_t b)
Definition: Printer.h:738
static INLINE void setYDirection(bool positive)
Definition: Printer.h:549
#define PRINTER_FLAG2_HOMING
Definition: Printer.h:94
int32_t l
Definition: Printer.h:55
static float yMin
Definition: Printer.h:344
#define PRINTER_FLAG1_ALLOW_COLD_EXTRUSION
Definition: Printer.h:87
#define START_STEP_WITH_HIGH
Definition: Repetier.h:402
static INLINE bool isManualMoveMode()
Definition: Printer.h:835
#define PRINTER_FLAG2_JAMCONTROL_DISABLED
Definition: Printer.h:93
static INLINE uint8_t isAutoretract()
Definition: Printer.h:734
static int8_t motorYorZ
Definition: Printer.h:378
static uint8_t mode
Definition: Printer.h:264
static INLINE uint8_t isAdvanceActivated()
Definition: Printer.h:609
#define PRINTER_FLAG2_DEBUG_JAM
Definition: Printer.h:92
static INLINE bool debugErrors()
Definition: Printer.h:430
static int32_t deltaCPosYSteps
Definition: Printer.h:294
static INLINE void setZHomed(uint8_t b)
Definition: Printer.h:653
#define Z2_ENABLE_PIN
Definition: Configuration.h:1389
#define PRINTER_FLAG0_MANUAL_MOVE_MODE
Definition: Printer.h:76
#define PRINTER_FLAG3_X_HOMED
Definition: Printer.h:96
static INLINE void setDebugJam(uint8_t b)
Definition: Printer.h:789
static INLINE float realYPosition()
Definition: Printer.h:1046
static int32_t xMinSteps
For software endstops, limit of move in negative direction.
Definition: Printer.h:338
#define PRINTER_FLAG1_AUTOMOUNT
Definition: Printer.h:81
#define X_ENABLE_ON
Definition: Configuration.h:879
static int32_t yMaxSteps
For software endstops, limit of move in positive direction.
Definition: Printer.h:336
static int16_t travelMovesPerSecond
Definition: Printer.h:296
static INLINE void insertStepperHighDelay()
Definition: Printer.h:1059
static INLINE bool getXDirection()
Definition: Printer.h:596
static int32_t deltaBPosXSteps
Definition: Printer.h:291
uint16_t speed_t
Definition: HAL.h:156
static INLINE uint8_t isAllEMotors()
Definition: Printer.h:773
static int currentLayer
Definition: Printer.h:387
static INLINE bool debugEcho()
Definition: Printer.h:422
static int32_t deltaBPosYSteps
Definition: Printer.h:292
#define WRITE(IO, v)
Write to a pin wrapper.
Definition: fastio.h:48
#define PRINTER_FLAG3_DOOR_OPEN
Definition: Printer.h:102
static INLINE void disableXStepper()
Disable stepper motor for x direction.
Definition: Printer.h:466
static INLINE void realPosition(float &xp, float &yp, float &zp)
copies currentPosition to parameter.
Definition: Printer.h:1054
static float offsetZ
Z-offset for different tool positions.
Definition: Printer.h:357
#define PRINTER_FLAG1_ALLKILLED
Definition: Printer.h:83
static float deltaMaxRadiusSquared
Definition: Printer.h:287
float z(float x, float y)
Definition: Printer.h:127
wizardVar()
Definition: Printer.h:62
static INLINE void setSupportStartStop(uint8_t b)
Definition: Printer.h:756
static INLINE void setAutoreportTemp(uint8_t b)
Definition: Printer.h:661
static INLINE uint8_t isAutoreportTemp()
Definition: Printer.h:657
#define PRINTER_FLAG1_UI_ERROR_MESSAGE
Definition: Printer.h:84
static float zBedOffset
Definition: Printer.h:267
static INLINE uint8_t isHoming()
Definition: Printer.h:766
static int16_t zBabysteps
Definition: Printer.h:331
static floatLong deltaDiagonalStepsSquaredA
Definition: Printer.h:284
static INLINE uint8_t isBlockingReceive()
Definition: Printer.h:725
static INLINE wizardVar popWizardVar()
Definition: Printer.h:1172
#define X_STEP_PIN
Definition: pins.h:3052
#define PRINTER_FLAG0_STEPPER_DISABLED
Definition: Printer.h:72
static uint8_t unitIsInches
0 = Units are mm, 1 = units are inches.
Definition: Printer.h:263
#define Y2_ENABLE_PIN
Definition: Configuration.h:1384
static int32_t deltaAPosXSteps
Definition: Printer.h:289
#define Z4_DIR_PIN
Definition: Configuration.h:1398
#define Z_ENABLE_ON
Definition: Configuration.h:881
Handle distortion related stuff.
Definition: Distortion.h:33
static float backlashZ
Definition: Printer.h:365
static INLINE bool isAutolevelActive()
Definition: Printer.h:841
static INLINE void setDeltaPositions(long xaxis, long yaxis, long zaxis)
Definition: Printer.h:1131
static int32_t stepsRemainingAtYHit
Definition: Printer.h:312
static int32_t deltaCPosXSteps
Definition: Printer.h:293
int16_t i
Definition: Printer.h:57
#define INVERT_Z_DIR
Definition: Configuration.h:898
#define PRINTER_FLAG1_HOMED_ALL
Definition: Printer.h:80
uint8_t uc
Definition: Printer.h:60
static INLINE void disableZStepper()
Disable stepper motor for z direction.
Definition: Printer.h:485
static INLINE void setAdvanceActivated(uint8_t b)
Definition: Printer.h:613
static speed_t vMaxReached
Maximum reached speed.
Definition: Printer.h:359
static INLINE void setAutomount(uint8_t b)
Definition: Printer.h:677
static float zLength
Definition: Printer.h:345
#define PRINTER_FLAG3_Y_HOMED
Definition: Printer.h:97
uint32_t ul
Definition: Printer.h:56
static INLINE void setMenuMode(uint16_t mode, bool on)
Definition: Printer.h:401
static INLINE uint8_t isPowerOn()
Definition: Printer.h:705
#define BOARD_FAN_SPEED
Definition: Configuration.h:1665
static float thermoMinTemp
Definition: Printer.h:323
static float backlashY
Definition: Printer.h:364
static uint16_t menuMode
Definition: Printer.h:246
static Extruder * current
Definition: Extruder.h:233
static INLINE uint8_t isYHomed()
Definition: Printer.h:640
wizardVar(uint16_t _f)
Definition: Printer.h:67
static uint32_t stepNumber
Step number in current move.
Definition: Printer.h:272
static INLINE bool debugDryrun()
Definition: Printer.h:434
static ufast8_t maxExtruderSpeed
Timer delay for end extruder speed.
Definition: Printer.h:239
static floatLong deltaDiagonalStepsSquaredB
Definition: Printer.h:285
static INLINE void startZStep()
Definition: Printer.h:950
static int32_t yMinSteps
For software endstops, limit of move in negative direction.
Definition: Printer.h:339
#define STEP_DOUBLER_FREQUENCY
Definition: Configuration.h:1173
static INLINE void setAnyTempsensorDefect()
Definition: Printer.h:828
#define TOWER_ARRAY
Definition: Repetier.h:134
static fast8_t multiZHomeFlags
Definition: Printer.h:369
static float extrudeMultiplyError
Accumulated error during extrusion.
Definition: Printer.h:279
static INLINE void toggleAnimation()
Definition: Printer.h:807
Definition: Printer.h:234
bool runBedLeveling(int save)
static INLINE void disableYStepper()
Disable stepper motor for y direction.
Definition: Printer.h:476
#define WIZARD_STACK_SIZE
Definition: Repetier.h:93
static int32_t zMaxStepsAdj
Definition: Printer.h:302
#define INVERT_Y_DIR
Definition: Configuration.h:897
#define PWM_BOARD_FAN
Definition: Repetier.h:888
static INLINE float realXPosition()
Definition: Printer.h:1042
static uint8_t flag1
Definition: Printer.h:268
static int8_t motorX
Definition: Printer.h:377
static int32_t zMinSteps
For software endstops, limit of move in negative direction.
Definition: Printer.h:340
static int32_t deltaFloorSafetyMarginSteps
Definition: Printer.h:288
static INLINE uint8_t isStartStopSupported()
Definition: Printer.h:752
static INLINE uint8_t isNoDestinationCheck()
Definition: Printer.h:697
static INLINE bool debugCommunication()
Definition: Printer.h:438
static INLINE void executeXYGantrySteps()
Definition: Printer.h:851
#define Z_AXIS
Definition: Repetier.h:122
static INLINE void setXHomed(uint8_t b)
Definition: Printer.h:635
static INLINE uint8_t isZHomed()
Definition: Printer.h:649
static float yLength
Definition: Printer.h:343
static INLINE void updateHomedAll()
Definition: Printer.h:626
uint8_t ufast8_t
Definition: HAL.h:161
static float memoryY
Definition: Printer.h:372
#define Z_PROBE_REPETITIONS
Definition: Configuration.h:1478
#define Y2_STEP_PIN
Definition: Configuration.h:1382
#define PRINTER_FLAG0_TEMPSENSOR_DEFECT
Definition: Printer.h:74
wizardVar(int32_t _f)
Definition: Printer.h:64
static INLINE void setZProbingActive(bool on)
Definition: Printer.h:845
static float extrusionFactor
Extrusion multiply factor.
Definition: Printer.h:280
static INLINE void setInterruptEvent(uint8_t evt, bool highPriority)
Definition: Printer.h:396
static INLINE void setXDirection(bool positive)
Definition: Printer.h:535
static int16_t zBabystepsMissing
Definition: Printer.h:330
static INLINE bool isZProbingActive()
Definition: Printer.h:848
static INLINE void setAllEMotors(uint8_t b)
Definition: Printer.h:777
static INLINE bool isMenuMode(uint8_t mode)
Definition: Printer.h:408
static INLINE uint8_t isDoorOpen()
Definition: Printer.h:760
static INLINE bool debugFlag(uint8_t flags)
Definition: Printer.h:450
static int32_t stepsRemainingAtXHit
Definition: Printer.h:311
static fast8_t wizardStackPos
Definition: Printer.h:391
#define PWM_FAN2
Definition: Repetier.h:890
wizardVar(int16_t _f)
Definition: Printer.h:66
static float maxZJerk
Maximum allowed jerk in z direction in mm/s.
Definition: Printer.h:353
static INLINE uint8_t isAnimation()
Definition: Printer.h:681
#define Z_DIR_PIN
Definition: pins.h:3065
#define Z3_STEP_PIN
Definition: Configuration.h:1392
#define Z_STEP_PIN
Definition: pins.h:3064
uint32_t millis_t
Definition: HAL.h:158
static float offsetY
Y-offset for different tool positions.
Definition: Printer.h:356
#define Z4_STEP_PIN
Definition: Configuration.h:1397
static INLINE uint8_t isDebugJam()
Definition: Printer.h:781
static INLINE uint8_t isAllKilled()
Definition: Printer.h:665
static INLINE void startXStep()
Definition: Printer.h:923
#define X2_DIR_PIN
Definition: Configuration.h:1370
#define DISABLE_Z
Definition: Configuration.h:886
#define E_TOWER_ARRAY
Definition: Repetier.h:135
#define Z2_STEP_PIN
Definition: Configuration.h:1387
uint32_t l
Definition: Printer.h:47
static INLINE void setZDirection(bool positive)
Definition: Printer.h:562
static int advanceStepsSet
Definition: Printer.h:241
static INLINE bool debugInfo()
Definition: Printer.h:426
static INLINE void setNoDestinationCheck(uint8_t b)
Definition: Printer.h:701
static INLINE void setPowerOn(uint8_t b)
Definition: Printer.h:709
static uint8_t fanSpeed
Definition: Printer.h:265
#define INVERT_X_DIR
Definition: Configuration.h:896
#define X_AXIS
Definition: Repetier.h:120
static INLINE int getFanSpeed()
Definition: Printer.h:1124
Definition: Printer.h:123
static int32_t xMaxSteps
For software endstops, limit of move in positive direction.
Definition: Printer.h:335
static INLINE bool debugEndStop()
Definition: Printer.h:446
static float backlashX
Definition: Printer.h:363
static INLINE uint8_t getDebugLevel()
Definition: Printer.h:419
static INLINE void setPrinting(uint8_t b)
Definition: Printer.h:747
static INLINE void debugReset(uint8_t flags)
Definition: Printer.h:458
#define C_TOWER
Definition: Repetier.h:133
#define PRINTER_FLAG3_SUPPORTS_STARTSTOP
Definition: Printer.h:101
#define X2_STEP_PIN
Definition: Configuration.h:1369
static INLINE uint8_t isDebugJamOrDisabled()
Definition: Printer.h:785
static INLINE void unsetAllSteppersDisabled()
Definition: Printer.h:819
#define PRINTER_FLAG2_ALL_E_MOTORS
Definition: Printer.h:95
static long advanceExecuted
Executed advance steps.
Definition: Printer.h:243
static float xLength
Definition: Printer.h:341
#define X_ENABLE_PIN
Definition: pins.h:3054
static INLINE void setAllKilled(uint8_t b)
Definition: Printer.h:669
int8_t fast8_t
Definition: HAL.h:160
Definition: Printer.h:53
static uint8_t interruptEvent
Event generated in interrupts that should/could be handled in main thread.
Definition: Printer.h:351
#define Y_ENABLE_ON
Definition: Configuration.h:880
#define INLINE
Definition: HAL.h:37
static INLINE uint8_t isAutomount()
Definition: Printer.h:673
#define Z3_ENABLE_PIN
Definition: Configuration.h:1394
#define Y_AXIS
Definition: Repetier.h:121
float c
Definition: Printer.h:126
#define MENU_MODE_PRINTING
Definition: Repetier.h:556
static INLINE void setColdExtrusionAllowed(uint8_t b)
Definition: Printer.h:717
uint8_t pwm_pos[NUM_PWM]
Definition: motion.cpp:78
static INLINE uint8_t isUIErrorMessage()
Definition: Printer.h:689
static int32_t zCorrectionStepsIncluded
Definition: Printer.h:305
#define Z_AXIS_ARRAY
Definition: Repetier.h:126
static float memoryX
Definition: Printer.h:371
static INLINE void pushWizardVar(wizardVar v)
Definition: Printer.h:1169
static float axisX1StepsPerMM
Definition: Printer.h:248
#define DISABLE_Y
Definition: Configuration.h:885
static INLINE bool getZDirection()
Definition: Printer.h:588
static uint32_t interval
Last step duration in ticks.
Definition: Printer.h:270
static void delayMicroseconds(unsigned int delayUs)
Definition: HAL.h:514
static float feedrate
Last requested feedrate.
Definition: Printer.h:347
#define PRINTER_FLAG0_LARGE_MACHINE
Definition: Printer.h:79
static unsigned int extrudeMultiply
Flow multiplier in percent (factor 1 = 100)
Definition: Printer.h:349
static float xMin
Definition: Printer.h:342
#define X2_ENABLE_PIN
Definition: Configuration.h:1371
static float offsetX
X-offset for different tool positions.
Definition: Printer.h:355
static float memoryE
Definition: Printer.h:374
static int32_t zMinStepsAdj
Definition: Printer.h:301
#define STEPPER_HIGH_DELAY
Definition: Configuration.h:1159
static float memoryF
Definition: Printer.h:375
static INLINE void unsetAnyTempsensorDefect()
Definition: Printer.h:832
#define PRINTER_FLAG1_NO_DESTINATION_CHECK
Definition: Printer.h:85
#define Y2_DIR_PIN
Definition: Configuration.h:1383
static INLINE float convertToMM(float x)
Definition: Printer.h:810
uint16_t ui
Definition: Printer.h:58
#define E_AXIS_ARRAY
Definition: Repetier.h:127
static float maxJerk
Maximum allowed jerk in mm/s.
Definition: Printer.h:350
static INLINE void enableZStepper()
Enable stepper motor for z direction.
Definition: Printer.h:520
float f
Definition: Printer.h:46
static millis_t lastTempReport
Definition: Printer.h:278
static fast8_t stepsPerTimerCall
Definition: Printer.h:266
static float zMin
Definition: Printer.h:346
static Distortion distortion
Definition: Printer.h:1160
float f
Definition: Printer.h:54
#define PRINTER_FLAG0_AUTOLEVEL_ACTIVE
Definition: Printer.h:77
static uint32_t timer
used for acceleration/deceleration timing
Definition: Printer.h:271
#define Y_STEP_PIN
Definition: pins.h:3058
#define Z4_ENABLE_PIN
Definition: Configuration.h:1399
#define PRINTER_FLAG1_ANIMATION
Definition: Printer.h:82
static INLINE void endXYZSteps()
Definition: Printer.h:983
static float axisX2StepsPerMM
Definition: Printer.h:249
static int32_t zMaxSteps
For software endstops, limit of move in positive direction.
Definition: Printer.h:337
wizardVar(float _f)
Definition: Printer.h:63
static uint8_t relativeCoordinateMode
Determines absolute (false) or relative Coordinates (true).
Definition: Printer.h:260
static INLINE uint8_t isColdExtrusionAllowed()
Definition: Printer.h:713
static INLINE uint8_t isJamcontrolDisabled()
Definition: Printer.h:794
static INLINE bool areAllSteppersDisabled()
Definition: Printer.h:813
static INLINE void executeXZGantrySteps()
Definition: Printer.h:881
static int32_t stepsRemainingAtZHit
Definition: Printer.h:308
#define PRINTER_FLAG0_SEPERATE_EXTRUDER_INT
Definition: Printer.h:73
#define B_TOWER
Definition: Repetier.h:132
#define PRINTER_FLAG3_AUTOREPORT_TEMP
Definition: Printer.h:100
static uint32_t maxInterval
Definition: Printer.h:255
static float filamentPrinted
mm of filament printed since counting started
Definition: Printer.h:361
static INLINE void setYHomed(uint8_t b)
Definition: Printer.h:644
static int32_t maxDeltaPositionSteps
Definition: Printer.h:282
#define PRINTER_FLAG2_BLOCK_RECEIVING
Definition: Printer.h:88
static int16_t printMovesPerSecond
Definition: Printer.h:297
static INLINE bool getYDirection()
Definition: Printer.h:592
static INLINE void enableXStepper()
Enable stepper motor for x direction.
Definition: Printer.h:501
static INLINE bool isAnyTempsensorDefect()
Definition: Printer.h:825
static INLINE int getFan2Speed()
Definition: Printer.h:1127
#define Z2_DIR_PIN
Definition: Configuration.h:1388
static int32_t deltaAPosYSteps
Definition: Printer.h:290
static INLINE float realZPosition()
Definition: Printer.h:1050
static uint8_t debugLevel
Bitfield defining debug output. 1 = echo, 2 = info, 4 = error, 8 = dry run., 16 = Only communication...
Definition: Printer.h:235
#define A_TOWER
Definition: Repetier.h:131
static uint8_t relativeExtruderCoordinateMode
Determines Absolute or Relative E Codes while in Absolute Coordinates mode. E is always relative in R...
Definition: Printer.h:261